# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Eric Bélanger <eric@archlinux.org>

pkgname=gupnp-igd
pkgver=1.2.0
pkgrel=1
pkgdesc="A library to handle UPnP IGD port mapping"
url="https://wiki.gnome.org/Projects/GUPnP"
arch=(x86_64)
license=(LGPL)
depends=(gupnp)
makedepends=(gobject-introspection git gtk-doc meson)
_commit=a0aafc79ac8e258f849cdb2924cb11ec9162d0c5  # tags/1.2.0-correct^0
source=("git+https://gitlab.gnome.org/GNOME/gupnp-igd.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-correct//;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build -D gtk_doc=true
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends+=(libg{lib,object,io}-2.0.so libg{ssdp,upnp}-1.2.so)
  provides+=(libgupnp-igd-1.0.so)

  DESTDIR="$pkgdir" meson install -C build
}

